const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    createProxyMiddleware('/devicearchives', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
    createProxyMiddleware('/patch', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
    createProxyMiddleware('/patchupgrade', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
    createProxyMiddleware('/app', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
    createProxyMiddleware('/appupgrade', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
    createProxyMiddleware('/alarminfo', {
      target: 'http://localhost:8155',
      changeOrigin: true,
    }),
  );
};